package com.bridgeintelligent.tag.webserver.dim.mgmt.service.mine;

import com.bridgeintelligent.tag.webserver.dim.mgmt.api.POIUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        URL resource = Test.class.getResource("/111.xlsx");
        System.out.println(resource);
        File file = new File(resource.getPath());
        System.out.println(resource);
        try {
            FileInputStream fileInputStream = new FileInputStream(file);
            MultipartFile excelFile = new MockMultipartFile(file.getName(), fileInputStream);
            System.out.println(excelFile.getSize());
            System.out.println(excelFile.getName());
            List<String[]> list = POIUtils.readExcel(excelFile);
            System.out.println("测试=" + list.size());

            System.out.println(list.toString());
        } catch (Exception e) {
            System.out.println("解析报错");
            e.printStackTrace();
        }


    }

}